package com.basker.pisces.domain.value;

public class NumberValue implements IValueObject {

    public final static NumberValue NULL_NUMBER = new NumberValue(null) {
        @Override
        public Object getDataValue() {
            return null;
        }

        @Override
        public String getPresentValue() {
            return "";
        }
    };

    private Number number;

    public NumberValue(Number number) {
        this.number = number;
    }

    @Override
    public Object getDataValue() {
        return number;
    }

    @Override
    public String getPresentValue() {
        return number != null ? number.toString() : "";
    }

    @Override
    public boolean isEmpty() {
        return number == null;
    }

    @Override
    public String toString() {
        return String.valueOf(number);
    }

}
